﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace KindleComic
{
    public partial class FrmMain : Form
    {
        public FrmMain()
        {
            InitializeComponent();
            ChangePanel("download");
        }

        private void tsBtnComicDowonld_Click(object sender, EventArgs e)
        {
            ChangePanel("download");
        }

        private void tsBtnComicCreate_Click(object sender, EventArgs e)
        {
            ChangePanel("create");
        }

        private void ChangePanel(string name)
        {
            switch (name)
            {
                case "download":
                    this.panel.Controls.Clear();
                    FrmComicDownload frmComicDownload = new FrmComicDownload();
                    frmComicDownload.TopLevel = false;
                    frmComicDownload.Dock = DockStyle.Fill;
                    frmComicDownload.FormBorderStyle = FormBorderStyle.None;
                    this.panel.Controls.Add(frmComicDownload);
                    frmComicDownload.Show();
                    break;
                case "create":
                    this.panel.Controls.Clear();
                    FrmComicCreate frmComicCreate = new FrmComicCreate();
                    frmComicCreate.TopLevel = false;
                    frmComicCreate.Dock = DockStyle.Fill;
                    frmComicCreate.FormBorderStyle = FormBorderStyle.None;
                    this.panel.Controls.Add(frmComicCreate);
                    frmComicCreate.Show();
                    break;
            }
        }
    }
}
